package com.licheedev.demo.dao;

import java.util.Map;

import org.greenrobot.greendao.AbstractDao;
import org.greenrobot.greendao.AbstractDaoSession;
import org.greenrobot.greendao.database.Database;
import org.greenrobot.greendao.identityscope.IdentityScopeType;
import org.greenrobot.greendao.internal.DaoConfig;

import com.licheedev.demo.histroy.CarInfo;
import com.licheedev.demo.histroy.HistroyBeam;

import com.licheedev.demo.dao.CarInfoDao;
import com.licheedev.demo.dao.HistroyBeamDao;

// THIS CODE IS GENERATED BY greenDAO, DO NOT EDIT.

/**
 * {@inheritDoc}
 * 
 * @see org.greenrobot.greendao.AbstractDaoSession
 */
public class DaoSession extends AbstractDaoSession {

    private final DaoConfig carInfoDaoConfig;
    private final DaoConfig histroyBeamDaoConfig;

    private final CarInfoDao carInfoDao;
    private final HistroyBeamDao histroyBeamDao;

    public DaoSession(Database db, IdentityScopeType type, Map<Class<? extends AbstractDao<?, ?>>, DaoConfig>
            daoConfigMap) {
        super(db);

        carInfoDaoConfig = daoConfigMap.get(CarInfoDao.class).clone();
        carInfoDaoConfig.initIdentityScope(type);

        histroyBeamDaoConfig = daoConfigMap.get(HistroyBeamDao.class).clone();
        histroyBeamDaoConfig.initIdentityScope(type);

        carInfoDao = new CarInfoDao(carInfoDaoConfig, this);
        histroyBeamDao = new HistroyBeamDao(histroyBeamDaoConfig, this);

        registerDao(CarInfo.class, carInfoDao);
        registerDao(HistroyBeam.class, histroyBeamDao);
    }
    
    public void clear() {
        carInfoDaoConfig.clearIdentityScope();
        histroyBeamDaoConfig.clearIdentityScope();
    }

    public CarInfoDao getCarInfoDao() {
        return carInfoDao;
    }

    public HistroyBeamDao getHistroyBeamDao() {
        return histroyBeamDao;
    }

}
